<!--
 * @Description: iframeGetMessage
 * @Author: rendc
 * @Date: 2025-11-14 09:56:07
 * @LastEditors: rendc
 * @LastEditTime: 2025-11-14 10:21:00
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>iframe - sendMessage - 子页面</title>
</head>
<body>
  <!-- 通过iframe标签通信 - 收消息 -->
  这是iframe小页面
</body>
<script>
  // 子窗口监听message事件
  window.addEventListener("message",function(e){
    // 数据
    console.log('🤡 CC -  e.data:',  e.data);
    //源
    console.log('🤡 CC - e.origin:', e.origin);
  })
</script>
</html>